package homework0302;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionOperDemo1 {
    public static void main(String[] args) {
        Collection c1=new ArrayList();
        c1.add("int");
        c1.add("byte");
        c1.add("short");
        c1.add("long");
        c1.add("double");
        System.out.println(c1);

        Collection c2=new ArrayList();
        c2.add("float");
        c2.add("byte");
        c2.add("short");
        c2.add("String");
        c2.add("char");
        System.out.println(c2);

        //c1.addAll(c2);
        //System.out.println(c1);
        System.out.println(c1.containsAll(c2));

        c1.retainAll(c2);
        System.out.println(c1);
        System.out.println(c2);



        c1.removeAll(c2);
        System.out.println(c1);
        System.out.println(c2);
    }
}
